package com.company.cloud.mall.modules.app.models;

import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
public class PayResultModel {

	
	 private String state;
	 
	 private String memo;
	 
     private String thirdState;

     private String thirdMemo;
     
     public PayResultModel(String state, String thirdState) {
    	 this.state=state;
    	 this.thirdState=thirdState;
     }
     
     
     
     
//     public static PayResultModel getRefundResultModel(PayChannelTypeEnum channel, String thirdState) {
//    	 PayResultModel model=new PayResultModel(thirdState);
//    	 if(channel==PayChannelTypeEnum.WX_JSAPI) {
//    		  String state= PayResultModel.getWxMiniRefundState(thirdState);
//    		  model.setState(state);
//    	 }
//    	 return model;
//     }
//     
//     public PayResultModel(PayChannelTypeEnum channel, String thirdState,String thirdMemo) {
//    	 this.thirdState=thirdState;
//    	 this.thirdMemo=thirdMemo;
//    	 if(channel==PayChannelTypeEnum.WX_JSAPI) {
//    		 this.state=PayResultModel.getWxMiniPayState(thirdState);
//    	 }
//     }
//     
//     public static String getWxMiniRefundState(String thirdState) {
//    	 if("SUCCESS".equals(thirdState)) { //SUCCESS—退款成功
//    		 return RefundStateEnum.Refund_Success.getCode();
//    	 }else if("REFUNDCLOSE".equals(thirdState)) { //REFUNDCLOSE—退款关闭
//    		 return RefundStateEnum.Refund_Close.getCode();
//    	 }else if("PROCESSING".equals(thirdState)) { //PROCESSING—退款处理中
//    		 return RefundStateEnum.Refund_Ing.getCode();
//    	 }else if("CHANGE".equals(thirdState)) {// CHANGE—退款异常，退款到银行发现用户的卡作废或者冻结了，导致原路退款银行卡失败
//    		 return RefundStateEnum.Refund_Ing.getCode();
//    	 }else {
//    		 throw new BusinessException(ShopErrorEnum.Pay_State_Unsupported);
//    	 }
//    	 
//     }
//     
//     public static String getWxMiniPayState(String thirdState) {
//    	 if("SUCCESS".equals(thirdState)) { //SUCCESS—支付成功
//    		 return PayStateEnum.Pay_Success.getCode();
//    	 }else if("NOTPAY".equals(thirdState)) { //NOTPAY—未支付
//    		 return PayStateEnum.Pay_Not.getCode();
//    	 }else if("CLOSED".equals(thirdState)) { //CLOSED—已关闭
//    		 return PayStateEnum.Pay_Fail.getCode();
//    	 }else if("REVOKED".equals(thirdState)) { //REVOKED—已撤销（付款码支付）
//    		 return PayStateEnum.Pay_Fail.getCode();
//    	 }else if("PAYERROR".equals(thirdState)) { //PAYERROR--支付失败(其他原因，如银行返回失败)
//    		 return PayStateEnum.Pay_Fail.getCode();
//    	 }else if("USERPAYING".equals(thirdState)) { //USERPAYING--用户支付中（付款码支付）
//    		 return PayStateEnum.Pay_Ing.getCode();
//    	 }else if("REFUND".equals(thirdState)) { //REFUND—转入退款
//    		 return PayStateEnum.Pay_Success.getCode();
//    	 }else if("FAIL".equals(thirdState)) {
//    		 return PayStateEnum.Pay_Fail.getCode();
//    	 }else {
//    		 throw new BusinessException(ShopErrorEnum.Pay_State_Unsupported);
//    	 }
//     }
//     
     
     
     

	
}
